package edu.xpu.cs.hub.controller;

import edu.xpu.cs.hub.entity.Node;
import edu.xpu.cs.hub.service.NodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author zaj
 * 提供节点信息、执行等
 */
@RestController
@RequestMapping("/nodes")
public class NodeController {
    @Autowired
    NodeService nodeService;

    @GetMapping("nodesInfo")
    public List<Node> nodeInfo(String nodesName){
        return nodeService.nodesInfo(nodesName);
    }

    @PostMapping("deleteNodes")
    public String deleteNodes(@RequestParam("nodeName") String nodeName){
        return nodeService.deleteNodes(nodeName);
    }
}
